import { useI18n } from '@/locales/useI18n'

const { t } = useI18n('common')

type Align = 'left' | 'right'

export const footerProps = {
  confirmLoading: { type: Boolean },
  /**
   * @description: Show close button
   */
  showCancelBtn: { type: Boolean, default: true },
  cancelButtonProps: Object as PropType<Recordable>,
  cancelText: { type: String, default: t('common.cancelText') },
  /**
   * @description: Show confirmation button
   */
  showOkBtn: { type: Boolean, default: true },
  okButtonProps: Object as PropType<Recordable>,
  okText: { type: String, default: t('common.confirmText') },
  okType: { type: String, default: 'primary' },
  showFooter: { type: Boolean, default: true },
  footerHeight: {
    type: [String, Number] as PropType<string | number>,
    default: 60
  },
  align: { type: String as PropType<Align>, default: 'right' }
}

export const basicProps = {
  title: { type: String, default: '' },
  visible: { type: Boolean },
  destroyOnClose: { type: Boolean, default: true },
  closeFunc: {
    type: [Function, Object] as PropType<any>,
    default: null
  },
  ...footerProps
}